document.addEventListener('plusready', function() {
//	plus.geolocation.getCurrentPosition(function(p) {
//		if(!p.address) {
//			toast('无法获取您的位置！');
//			return;
//		}else{
//			var address = p.address;
//			$('.address').text(address.city + address.district);
//		}
//	}, function() {}, { provider: 'baidu', coordsType: 'bd09ll', geocode: true });
	showWating();
	//
	$.ajax({
		type: "get",
		url: apiRoot + "/home/bespoke/bespokeList",
		dataType: 'json',
		success: function(data) {
			if(data.length > 0) {
				var list = '';
				$.each(data, function(k, v) {
					//					console.log(JSON.stringify(v)); 
					list += '<li class="mui-table-view-cell mui-media" aid="' + v.aid + '">' +
						'<a href="javascript:;">' +
						'<img class="mui-media-object mui-pull-left" src="' + getAvatar(v.pic) + '">' +
						'<div class="mui-media-body">' +
						'<div><span class="huiming">' + v.title + '</span><span class="mui-pull-right"><button type="button" class="mui-btn ' + (v.isnumber == 1 ? '' : 'full') + '" >' +
						(v.isnumber == 1 ? '有号' : '已满') +
						'</button></span></div>' +
						'<p class="mui-ellipsis firstp">' + v.address + '</p>' +
						'</div>' +
						'</a>' +
						'</li>';
				});
				$('#content ul').html(list);
				$('.mui-media').on('tap', function() {
					var aid = $(this).attr('aid');
					goNewPage('yuyue-hospital.html', { aid: aid })
				})
			}
			plus.nativeUI.closeWaiting();	
		},
		error: function(e) {
//			plus.nativeUI.closeWaiting();
//			console.log(JSON.stringify(e));
			errortoast();
		}
	});
}, false)